<template>
  <div class="findpwd-success">
    <div class="success-title"><span class="success-text">{{$t('message.resetPwdSuccess')}}!</span></div>
    <div class="tip">{{second}}{{$t('message.goToLogin')}}</div>
  </div>
</template>

<script>
export default {
  name: 'FindPasswordSuccess',
  data () {
    return {
      second: 5
    }
  },
  methods: {
    toLogin () {
      let timer = setInterval(() => {
        this.second--
        if (this.second === 0) {
          clearInterval(timer)
          this.$router.push({ path: '/login' })
        }
      }, 1000)
    }
  },
  created () {
    this.toLogin()
  }
}
</script>

<style scoped>
.findpwd-success {
  padding: 40px 0;
}

.success-title {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
}
.success-text {
  position: relative;
}

.success-text:before {
  content: '';
  display: block;
  width: 28px;
  height: 28px;
  background: url(../../assets/images/findpwd/icon_success_28px.png);
  position: absolute;
  top: 0;
  left: -40px;
}

.tip {
  text-align: center;
  margin-top: 38px;
  color: #747474;
}
</style>